package com.quanyan.club.mq.producer;

import com.quanyan.club.mq.constant.MqConstant;
import com.quanyan.mq.mq.producer.AbstractMqProducer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * Created by zhang on 16/7/21.
 */
@Component
public class ClubXpLevelProducer extends AbstractMqProducer {

    public static final Logger logger = LoggerFactory.getLogger(ClubXpLevelProducer.class);

    @Value("${mq.nameServer.address}")
    private String nameServerAddress;

    @Override
    protected String getProducerGroup() {
        return MqConstant.CLUB_XP_LEVEL_GROUP_NAME;
    }

    @Override
    protected String getNameServerAddress() {
        return nameServerAddress;
    }

    @Override
    protected String getInstanceName() {
        return MqConstant.CLUB_XP_LEVEL_INSTANCE_NAME;
    }

    @PostConstruct
    void run() {
        super.start();
        logger.warn("俱乐部等级经验Producer启动成功 { }",System.currentTimeMillis());
    }

}
